package vn.codespot.hms.task;

import vn.codespot.hms.model.request.FeesRequestModel;
import vn.codespot.hms.model.response.FeesRepsonseModel;
import android.content.Context;

public class CheckingFeesTask extends AbstractTask {
    private ITaskListener mListener;

    private String mType;

    private int mPerson;

    private Boolean mUrgently;

    private String mDateArrival;

    private String mCouponCode;

    private String mPrimaryEmail;

    private FeesRepsonseModel mResp;

    public CheckingFeesTask(Context context, ITaskListener listener, String visaType, int person, Boolean urgently, String dateArrival,
            String couponCode, String primaryEmail) {
        super(context, "Checking fee", "Cancel checking fees");
        mListener = listener;
        mType = visaType;
        mPerson = person;
        mUrgently = urgently;
        mDateArrival = dateArrival;
        mCouponCode = couponCode;
        mPrimaryEmail = primaryEmail;
    }

    @Override
    protected void executes() {
        FeesRequestModel request = new FeesRequestModel();
        request.setVisaType(mType);
        request.setPerson(mPerson);
        request.setUrgently(mUrgently);
        request.setDateArrival(mDateArrival);
        request.setCouponCode(mCouponCode);
        request.setPrimaryEmail(mPrimaryEmail);

        mResp = mService.getFees(request);
    }

    @Override
    protected void finish() {
        mListener.finish(mResp);
    }
}
